# -*- coding: utf-8 -*-
"""
Created on Fri Dec 11 19:51:14 2020

@author: Administrator
"""

import json
class WebJson(object):
    
    def __init__(self,status=200,message="",data={}):
        self.__result={"status":status,"message":message,"data":data}
      
    #添加key-value数据
    def put(self,key,value):
        self.__result["data"][key]=value
        
    #从一个字典添加很多key-value数据
    def update(self,kv):
        self.__result.update(kv)
        
        
    def toJson(self):
        return json.dumps(self.__result)
        
    def __str__(self):
        return json.dumps(self.__result) 